package com.daxt.service;

import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.baomidou.mybatisplus.extension.service.IService;
import com.daxt.common.result.Result;
import com.daxt.common.result.ResultCode;
import com.daxt.model.dto.Classifys;
import com.daxt.model.service.base.param.EditUser;
import com.daxt.model.service.base.param.LoginInfo;
import com.daxt.model.service.base.result.UserInfo;
import com.daxt.model.service.base.vo.BaseUser;
import com.daxt.model.service.base.vo.Role;
import com.daxt.model.service.base.vo.UserClassify;
import org.apache.poi.ss.formula.functions.T;

public interface UserService extends IService<BaseUser> {
	
	public Result<UserInfo> login(LoginInfo loginInfo, HttpServletRequest request);

	Result<String> refToken(String token);

	
	 Result<String> logout(String token);

	
	 Result<String> checkExpriToken(ResultCode code, String token) throws UnsupportedEncodingException ;

	
//	boolean saveOrUpdate(EditUser entity);


	/**
	 * @description: 获取登录用户的数据权限
	 *
	 * @author: lig
	 * @date: 2021/6/18
	 */
	List<UserClassify> getUserClassify(UserInfo loginInfo);


	/**
	 * @description: 构造用户权限集
	 *
	 * @author: lig
	 * @date: 2021/7/7
	 */
	Classifys buildUserClassifys(UserInfo loginInfo);


	/**
	 * @description: 构造用户《部门》权限集
	 *
	 * @author: lig
	 * @date: 2021/7/7
	 */
	Classifys buildUserDeptPermissions(UserInfo loginInfo);



	List<BaseUser> gainDeptPostUser(Map<String, Object> param);

	/**
	 * @description: 获取部门名称集，逗号分割   通过用户ID
	 *
	 * @author: lig
	 * @date: 2022/1/10
	 */
	String gainDeptNameByUserId(String userId);


	/**
	 * @description: 构造 功能
	 *
	 * @author: lig
	 * @date: 2022/1/13
	 */
	void buildFunction(UserInfo loginUser);



	/**
	 * @description: 验证用户岗位信息
	 *
	 * @author: lig
	 * @date: 2022/1/20
	 */
	Result<String> verifyUserPost(BaseUser baseUser , List<String> postIds);



	/**
	 * @description: 保存更新用户相关数据
	 *
	 * @author: lig
	 * @date: 2022/1/20
	 */
	void saveUserRelevance(EditUser entity);

	/**
	 * 同步外部用户数据新
	 */
	void syncUserInfoNew(Date date);

	void buildUserRole(Role role);



}
